package net.mysoft.budgetsoft.system.action;


import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.stereotype.Controller;

import net.mysoft.budgetsoft.system.pagemodel.BudgetInitEdit;
import net.mysoft.budgetsoft.system.pagemodel.ToDoInfo;
import net.mysoft.framework.authority.AccessType;
import net.mysoft.framework.authority.Permission;
import net.mysoft.framework.base.BaseAction;
import net.mysoft.framework.model.DataGrid;
import net.mysoft.budgetsoft.system.service.BudgetInitEditService;
import com.opensymphony.xwork2.ModelDriven;
@Action(value = "budgetInitEditAction", results = { 
		@Result(name = "budgetInitEdit", location = "/platform/supreport/budgetInitEdit.jsp"), 
		@Result(name = "loadMain", location = "/platform/supreport/supcanTest.jsp"),
		@Result(name="loadOrganize",location="/platform/supreport/TreeViewTemp.jsp"),
		@Result(name = "treeList", location = "/platform/supreport/supTreeList.jsp"),
		@Result(name = "gongNengEdit", location = "/platform/system/gongNengEdit.jsp"), 
		@Result(name = "gongNengView", location = "/platform/system/gongNengView.jsp") })
@Controller("budgetInitEditAction")
public class BudgetInitEditAction extends BaseAction implements
		ModelDriven<BudgetInitEdit> {
	private static final Logger logger = Logger.getLogger(BudgetInitEditAction.class);
	@Resource
	private BudgetInitEditService budgetInitEditService;

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public BudgetInitEdit getModel() {
		// TODO Auto-generated method stubsupcanTest.jsp
		return null;
	}
	@Permission(access=AccessType.LOGIN)
	public String loadMain() {
		return "loadMain";
	}
	@Permission(access=AccessType.LOGIN)
	public String loadOrganize() {
		return "loadOrganize";
	}
	@Permission(access=AccessType.LOGIN)
	public String treeList() {
		return "treeList";
	}
	@Permission(access=AccessType.LOGIN)
	public String budgetInitEdit(){
		return "budgetInitEdit";
	}
	@Permission (access=AccessType.LOGIN)
	public String find(){
		
		List<BudgetInitEdit> list=budgetInitEditService.find(null);
		DataGrid dGrid=new DataGrid();
		dGrid.setRows(list);
		super.writeJson(dGrid);
		return "budgetInitEdit123";
	}

}
